﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WL.Model
{
    /// <summary>
    /// 表格对象
    /// </summary>
    public class Table
    {
        public int id { get; set; }
        public string name { get; set; }
        public int ignore { get; set; }
        public List<Field> fields { get; set; }
        public string sheetname { get; set; }
    }

    public class Field
    {
        public int id { get; set; }
        public string name { get; set; }
        public int search { get; set; }
        public string type
        {
            get
            {
                string t = "";
                switch (typeid)
                {
                    case 0:
                        t = "数字";
                        break;
                    case 1:
                        t = "文本";
                        break;
                    default:
                        t = "未知";
                        break;
                }
                return t;
            }
        }
        public string dbtype
        {
            get
            {
                string t = "";
                switch (typeid)
                {
                    case 0:
                        t = "int";
                        break;
                    case 1:
                        t = "varchar";
                        break;
                    default:
                        t = "varchar";
                        break;
                }
                return t;

            }
        }
        public int typeid { get; set; }

        public Table table { get; set; }

        /// <summary>
        /// 表格id
        /// </summary>
        public int pid { get; set; }


        public int sortid { get; set; }

    }

}